import { Action } from '@ngrx/store';

import { ViewModel } from '../../models';

export enum ViewActionTypes {
    VIEW_UPDATE = '[View] View Update',
    VIEW_CENTER = '[View] View Center',
    VIEW_ZOOM = '[View] View Zoom',
    VIEW_MINZOOM = '[View] View Minzoom',
    VIEW_MAXZOOM = '[View] View Maxzoom',
    VIEW_DISABLED_ZOOM_IN = '[View] View Disabled Zoom In',
    VIEW_DISABLED_ZOOM_OUT = '[View] View Disabled Zoom Out'
}

export class ViewUpdate implements Action {
    readonly type = ViewActionTypes.VIEW_UPDATE;
    constructor(public payload: ViewModel) {}
}

export class ViewCenter implements Action {
    readonly type = ViewActionTypes.VIEW_CENTER;
    constructor(public payload: number[]) {}
}

export class ViewZoom implements Action {
    readonly type = ViewActionTypes.VIEW_ZOOM;
    constructor(public payload: number) {}
}

export class ViewMinZoom implements Action {
    readonly type = ViewActionTypes.VIEW_MINZOOM;
    constructor(public payload: number) {}
}

export class ViewMaxZoom implements Action {
    readonly type = ViewActionTypes.VIEW_MAXZOOM;
    constructor(public payload: number) {}
}

export class ViewDisabledZoomIn implements Action {
    readonly type = ViewActionTypes.VIEW_DISABLED_ZOOM_IN;
    constructor(public payload: boolean) {}
}

export class ViewDisabledZoomOut implements Action {
    readonly type = ViewActionTypes.VIEW_DISABLED_ZOOM_OUT;
    constructor(public payload: boolean) {}
}

export type ViewAction 
    = ViewUpdate
    | ViewCenter
    | ViewZoom
    | ViewMinZoom
    | ViewMaxZoom
    | ViewDisabledZoomIn
    | ViewDisabledZoomOut;